home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / Dictionary.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  5.0 KB  |  197 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dictionary.a
  3. ;
  4. ;    Contains:    Dictionary Manager Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__DICTIONARY__') = 'UNDEFINED' THEN
  21. __DICTIONARY__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  30.     include 'Files.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33. ;        include 'OSUtils.a'                                        ;
  34. ;            include 'Memory.a'                                        ;
  35. ;        include 'Finder.a'                                            ;
  36.  
  37. ; Dictionary data insertion modes 
  38. kInsert                            EQU        0                    ; Only insert the input entry if there is nothing in the dictionary that matches the key. 
  39. kReplace                        EQU        1                    ; Only replace the entries which match the key with the input entry. 
  40. kInsertOrReplace                EQU        2                    ; Insert the entry if there is nothing in the dictionary which matches the key. 
  41. ;                           If there is already matched entries, replace the existing matched entries with the input entry. 
  42.  
  43. ; This Was InsertMode 
  44. ; typedef short             DictionaryDataInsertMode
  45.  
  46. ; Key attribute constants 
  47. kIsCaseSensitive                EQU        $10                    ; case sensitive = 16        
  48. kIsNotDiacriticalSensitive        EQU        $20                    ; diac not sensitive = 32    
  49.  
  50. ; Registered attribute type constants.    
  51. kNoun                            EQU        -1
  52. kVerb                            EQU        -2
  53. kAdjective                        EQU        -3
  54. kAdverb                            EQU        -4
  55.  
  56. ; This Was AttributeType 
  57. ; typedef SInt8             DictionaryEntryAttribute
  58. ; Dictionary information record 
  59. DictionaryInformation     RECORD    0
  60. dictionaryFSSpec         ds     FSSpec    ; offset: $0 (0)
  61. numberOfRecords             ds.l   1        ; offset: $46 (70)
  62. currentGarbageSize         ds.l   1        ; offset: $4A (74)
  63. script                     ds.w   1        ; offset: $4E (78)
  64. maximumKeyLength         ds.w   1        ; offset: $50 (80)
  65. keyAttributes             ds.b   1        ; offset: $52 (82)
  66. filler                     ds.b   1        ; offset: $53 (83)
  67. sizeof                     EQU *            ; size:   $54 (84)
  68.                         ENDR
  69.  
  70. ; typedef struct DictionaryInformation  DictionaryInformation
  71. DictionaryAttributeTable RECORD    0
  72. datSize                     ds.b   1        ; offset: $0 (0)
  73. datTable                 ds.b   1        ; offset: $1 (1)
  74. sizeof                     EQU *            ; size:   $2 (2)
  75.                         ENDR
  76.  
  77. ; typedef struct DictionaryAttributeTable  DictionaryAttributeTable
  78. ; typedef DictionaryAttributeTable  *DictionaryAttributeTablePtr
  79. ;
  80. ; pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
  81. ;
  82.     IF ¬ GENERATINGCFM THEN
  83.         Macro
  84.         _InitializeDictionary
  85.             move.w    #$0500,d0
  86.             dc.w     $AA53
  87.         EndM
  88.     ELSE
  89.         IMPORT_CFM_FUNCTION    InitializeDictionary
  90.     ENDIF
  91.  
  92. ;
  93. ; pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
  94. ;
  95.     IF ¬ GENERATINGCFM THEN
  96.         Macro
  97.         _OpenDictionary
  98.             move.w    #$0501,d0
  99.             dc.w     $AA53
  100.         EndM
  101.     ELSE
  102.         IMPORT_CFM_FUNCTION    OpenDictionary
  103.     ENDIF
  104.  
  105. ;
  106. ; pascal OSErr CloseDictionary(SInt32 dictionaryReference)
  107. ;
  108.     IF ¬ GENERATINGCFM THEN
  109.         Macro
  110.         _CloseDictionary
  111.             move.w    #$0202,d0
  112.             dc.w     $AA53
  113.         EndM
  114.     ELSE
  115.         IMPORT_CFM_FUNCTION    CloseDictionary
  116.     ENDIF
  117.  
  118. ;
  119. ; pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  120. ;
  121.     IF ¬ GENERATINGCFM THEN
  122.         Macro
  123.         _InsertRecordToDictionary
  124.             move.w    #$0703,d0
  125.             dc.w     $AA53
  126.         EndM
  127.     ELSE
  128.         IMPORT_CFM_FUNCTION    InsertRecordToDictionary
  129.     ENDIF
  130.  
  131. ;
  132. ; pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
  133. ;
  134.     IF ¬ GENERATINGCFM THEN
  135.         Macro
  136.         _DeleteRecordFromDictionary
  137.             move.w    #$0404,d0
  138.             dc.w     $AA53
  139.         EndM
  140.     ELSE
  141.         IMPORT_CFM_FUNCTION    DeleteRecordFromDictionary
  142.     ENDIF
  143.  
  144. ;
  145. ; pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  146. ;
  147.     IF ¬ GENERATINGCFM THEN
  148.         Macro
  149.         _FindRecordInDictionary
  150.             move.w    #$0805,d0
  151.             dc.w     $AA53
  152.         EndM
  153.     ELSE
  154.         IMPORT_CFM_FUNCTION    FindRecordInDictionary
  155.     ENDIF
  156.  
  157. ;
  158. ; pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  159. ;
  160.     IF ¬ GENERATINGCFM THEN
  161.         Macro
  162.         _FindRecordByIndexInDictionary
  163.             move.w    #$0A06,d0
  164.             dc.w     $AA53
  165.         EndM
  166.     ELSE
  167.         IMPORT_CFM_FUNCTION    FindRecordByIndexInDictionary
  168.     ENDIF
  169.  
  170. ;
  171. ; pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
  172. ;
  173.     IF ¬ GENERATINGCFM THEN
  174.         Macro
  175.         _GetDictionaryInformation
  176.             move.w    #$0407,d0
  177.             dc.w     $AA53
  178.         EndM
  179.     ELSE
  180.         IMPORT_CFM_FUNCTION    GetDictionaryInformation
  181.     ENDIF
  182.  
  183. ;
  184. ; pascal OSErr CompactDictionary(SInt32 dictionaryReference)
  185. ;
  186.     IF ¬ GENERATINGCFM THEN
  187.         Macro
  188.         _CompactDictionary
  189.             move.w    #$0208,d0
  190.             dc.w     $AA53
  191.         EndM
  192.     ELSE
  193.         IMPORT_CFM_FUNCTION    CompactDictionary
  194.     ENDIF
  195.  
  196.     ENDIF ; __DICTIONARY__
  197.